/**
 * 模态框组件样式
 * @description 自定义模态框组件的样式定义
 */

.modal {
  /* 基础样式 */
  border-radius: 8px;
  overflow: hidden;
}

/* 不同尺寸的模态框 */
.modal.small :global(.ant-modal-content) {
  max-height: 60vh;
}

.modal.medium :global(.ant-modal-content) {
  max-height: 70vh;
}

.modal.large :global(.ant-modal-content) {
  max-height: 80vh;
}

.modal.fullscreen {
  top: 0;
  padding: 0;
  margin: 0;
  max-width: 100vw;
  height: 100vh;
}

.modal.fullscreen :global(.ant-modal-content) {
  height: 100vh;
  border-radius: 0;
  max-height: none;
}

/* 内容区域 */
.content {
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.modal.fullscreen .content {
  max-height: calc(100vh - 120px);
  padding: 16px;
}

/* 底部按钮区域 */
.footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 0 0 0;
  border-top: 1px solid #f0f0f0;
  margin-top: 16px;
}

/* 模态框头部样式 */
.modal :global(.ant-modal-header) {
  border-bottom: 1px solid #f0f0f0;
  padding: 16px 24px;
  margin-bottom: 0;
}

.modal :global(.ant-modal-title) {
  font-size: 16px;
  font-weight: 600;
  color: #262626;
}

/* 模态框主体样式 */
.modal :global(.ant-modal-body) {
  padding: 24px;
}

/* 关闭按钮样式 */
.modal :global(.ant-modal-close) {
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.modal :global(.ant-modal-close:hover) {
  background-color: #f5f5f5;
}

.modal :global(.ant-modal-close-x) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 16px;
  color: #8c8c8c;
}

/* 遮罩层样式 */
.modal :global(.ant-modal-mask) {
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .modal {
    margin: 0;
    max-width: 100vw;
    width: 100vw !important;
  }

  .modal :global(.ant-modal-content) {
    border-radius: 0;
    height: 100vh;
    max-height: none;
  }

  .modal :global(.ant-modal-body) {
    padding: 16px;
    height: calc(100vh - 120px);
    overflow-y: auto;
  }

  .content {
    max-height: none;
    height: 100%;
  }

  .footer {
    padding: 16px;
    margin: 0;
    border-top: 1px solid #f0f0f0;
    background-color: #ffffff;
    position: sticky;
    bottom: 0;
  }
}

/* 深色主题适配 */
[data-theme='dark'] .modal :global(.ant-modal-content) {
  background-color: #1f1f1f;
  color: #d9d9d9;
}

[data-theme='dark'] .modal :global(.ant-modal-header) {
  background-color: #1f1f1f;
  border-bottom-color: #303030;
}

[data-theme='dark'] .modal :global(.ant-modal-title) {
  color: #d9d9d9;
}

[data-theme='dark'] .modal :global(.ant-modal-close:hover) {
  background-color: #262626;
}

[data-theme='dark'] .modal :global(.ant-modal-close-x) {
  color: #8c8c8c;
}

[data-theme='dark'] .footer {
  border-top-color: #303030;
}

[data-theme='dark'] .footer {
  background-color: #1f1f1f;
}

/* 动画效果 */
.modal :global(.ant-modal-content) {
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 全屏模态框特殊样式 */
.modal.fullscreen :global(.ant-modal-content) {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}